package com.yngk.tuyou.publish;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

import com.yngk.tuyou.FirstWs;
import com.yngk.tuyou.FirstWsImpl;

public class CxfPublish {

	public static void main(String[] args) {
		
		JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
		factory.setServiceClass(FirstWs.class);
		factory.setAddress("http://localhost:8888/tuyou");
		
		FirstWsImpl impl = new FirstWsImpl();
		factory.setServiceBean(impl);
		factory.getInInterceptors().add(new LoggingInInterceptor());
		factory.getOutFaultInterceptors().add(new LoggingOutInterceptor());
		factory.create();
	}
}
